package com.atguigu.list;

import javafx.util.Pair;
import org.junit.Test;

public class LinkedListTest {

    @Test
    public void testLinkedList(){
        LinkedList<Integer>list=new LinkedList<>();
        for (int i = 0; i < 10; i++) {
            list.addLast(i+10);
        }
        System.out.println(list);
        list.add(2,100);
        System.out.println(list);
        list.addFirst(98);
        System.out.println(list);
        System.out.println(list.contains(100));
        System.out.println(list.getFirst());
        System.out.println(list.getSize());
        list.set(2,88);
        System.out.println(list);
        System.out.println("----------------------");
        list.remove(2);
        System.out.println(list);
        System.out.println(list.removeFirst());
        System.out.println(list);
        System.out.println("----------------------");
        System.out.println(list.removeLast());
        System.out.println(list);
    }
    @Test
    public void testPair(){
        Pair<String,Integer> pair=new Pair<>("Hello",123);
        System.out.println(pair.getKey());
        System.out.println(pair.getValue());
    }
}
